<template>
  <van-tabs v-model:active="active">
    <van-tab :title="item.text" v-for="item in channels" :key="item.id"></van-tab>
  </van-tabs>
</template>

<script setup lang="ts">
import { onMounted, ref } from 'vue'
import axios from 'axios'

interface Channel {
  id: string
  text: string
}

onMounted(() => {
  init()
})

const active = ref(0)
const channels = ref<Channel[]>([])

async function init() {
  const { data } = await axios({
    url: '/navList',
    method: 'GET'
  })
  channels.value = data.result
}

</script>

<style scoped>

</style>